// [[ OnflowGenerator Entity UUID: 0eaa829788754fc9aeb752fd773c0702 ]]
package com.itdct.onflow.system.role.entity

import com.baomidou.mybatisplus.annotation.TableName
import com.itdct.onflow.core.annotation.Column
import com.itdct.onflow.core.annotation.ColumnRelateDict
import com.itdct.onflow.core.annotation.ColumnRelateId
import com.itdct.onflow.core.annotation.TableDescription
import com.itdct.onflow.core.entity.BaseUserEntity
import com.itdct.onflow.system.menu.entity.SysMenuEntity

/**
 * @author Zhouwx
 * @date 2025/8/25 15:24:25
 * @version 1.0
 * @description
 */
@TableDescription("角色菜单关联")
@TableName("sys_role_menu")
class SysRoleMenuEntity : BaseUserEntity() {
    @ColumnRelateId(targetClass = SysRoleEntity::class, targetFieldName = "name")
    @Column(comment = "角色id", nullable = false, indexed = true, sort = 10, forSelect = true)
    var roleId = 0L

    @ColumnRelateId(targetClass = SysMenuEntity::class, targetFieldName = "title")
    @Column(comment = "菜单id", nullable = false, indexed = true, sort = 20, forSelect = true)
    var menuId = 0L

    @ColumnRelateDict(dictCode = "platformType")
    @Column(comment = "平台类型", nullable = false, length = 64, defaultValue = "onflow-backend", indexed = true, sort = 2)
    var platformType = ""

    @Column(comment = "备注", length = 500, sort = 500)
    var remark: String? = null
}